home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / tests / ntest.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  1KB  |  55 lines

  1. #include <iostream.h>
  2. #include "Date.h"
  3.  
  4. main()
  5. {
  6. char buffer[1024];
  7.  
  8. NDR_send ndr1(buffer,1024);
  9.  
  10. Date birthday(12,25,65);
  11.  
  12. char *test1="abcde";
  13.  
  14. cout << "Birthday = " << birthday << endl;
  15. cout << "Encoding..." << endl;
  16.  
  17. ndr1 << char('a') << short(32767) << int(32768) << (unsigned short)(65000) 
  18.      << "My birthday:" << birthday << " which is xmas";
  19.  
  20. ndr1.insert(test1,5);
  21.  
  22. cout << "Encoded NDR is : " << ndr1;
  23.  
  24. NDR_receive ndr2(buffer,1024);
  25. Date bd;
  26. char m1[32];
  27. char  m2[32];
  28. char  test2[5];
  29. int count;
  30. char c;
  31. short s;
  32. unsigned short us;
  33. int i;
  34.  
  35. cout << "Decoding..." << endl;
  36.  
  37. ndr2 >> c >> s >> i >> us >> m1 >> bd >> m2;
  38.  
  39. ndr2.extract(test2,count);
  40.  
  41. cout << "c  = " << c << endl;
  42. cout << "s  = " << s << endl;
  43. cout << "i  = " << i << endl;
  44. cout << "us  = " << us << endl;
  45.  
  46. cout << "m1  = " << m1 << endl;
  47.  
  48. cout << "bd  = " << bd << endl;
  49.  
  50. cout << "m2  = " << m2 << endl;
  51. cout << "test2 = " << test2[0] << test2[1] << test2[2] << test2[3] << test2[4] << endl;
  52. cout << "count = " << count << endl;
  53.  
  54. }
  55.